package com.gongren.oddjob;

import java.util.Locale;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.gongren.oddjob.logger.BaseLogger;

/**
 * Handles requests for the application home page.
 */
@Controller
public class HomeController extends BaseLogger {

	/**
	 * 功能描述: 测试
	 * 
	 * @param locale
	 * @param model
	 * @return Author: yjg@gongren.com Date: 2017年8月2日 上午10:49:40 Version: 1.0.0
	 */
	
	@RequestMapping(value = "/")
	public String home() {
		return "home";
	}
	
	@RequestMapping(value = "/index")
	public String home(Locale locale, Model model,HttpServletRequest request) {
		logger.info("phone={},type={}",request.getParameter("principal"),request.getParameter("type"));
		return "home";
	}

	@RequestMapping(value = "/login")
	public String login(Locale locale, Model model) {
		return "login";
	}

	@RequestMapping(value = "/error")
	public String error(Locale locale, Model model,HttpServletRequest request) {
		logger.info("phone={},type={}",request.getParameter("principal"),request.getParameter("type"));
		return "error";
	}
}
